package com.example.xuanke.mapper;

import com.example.xuanke.pojo.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface StudentMapper {

    @Select("select * from student")
    List<Student> getAll();

    @Insert("insert into student (realname,eno,pwd,sex,age) value(#{realname},#{eno},#{pwd},#{sex},#{age})")
    void add(Student student);

    @Update("update student set realname=#{realname},eno=#{eno},pwd=#{pwd},sex=#{sex},age=#{age} where id=#{id}")
    void update(Student student);

    @Delete("delete from student where id=#{id}")
    void delete(Integer id);
}
